<html><head><title>R: Barrier Option evaluation using Closed-Form solution</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for BarrierOption {RQuantLib}"><tr><td>BarrierOption {RQuantLib}</td><td align="right">R Documentation</td></tr></table>
<h2>Barrier Option evaluation using Closed-Form solution</h2>


<h3>Description</h3>

<p>
This function evaluations an Barrier option on a common stock
using a closed-form solution. The option value as well as the common first
derivatives ("Greeks") are returned.
</p>


<h3>Usage</h3>

<pre>
BarrierOption.default(barrType, type, underlying, strike, dividendYield,
                      riskFreeRate, maturity, volatility,
                      barrier, rebate=0.0)

## S3 method for class 'Option':
print
## S3 method for class 'Option':
summary
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>barrType</code></td>
<td>
A string with one of the values <code>downin</code>,
<code>downout</code>, <code>upin</code> or <code>upout</code></td></tr>
<tr valign="top"><td><code>type</code></td>
<td>
A string with one of the values <code>call</code> or <code>put</code></td></tr>
<tr valign="top"><td><code>underlying</code></td>
<td>
Current price of the underlying stock</td></tr>
<tr valign="top"><td><code>strike</code></td>
<td>
Strike price of the option</td></tr>
<tr valign="top"><td><code>dividendYield</code></td>
<td>
Continuous dividend yield (as a fraction) of the stock</td></tr>
<tr valign="top"><td><code>riskFreeRate</code></td>
<td>
Risk-free rate</td></tr>
<tr valign="top"><td><code>maturity</code></td>
<td>
Time to maturity (in fractional years)</td></tr>
<tr valign="top"><td><code>volatility</code></td>
<td>
Volatility of the underlying stock</td></tr>
<tr valign="top"><td><code>barrier</code></td>
<td>
Option barrier value</td></tr>
<tr valign="top"><td><code>rebate</code></td>
<td>
Optional option rebate, defaults to 0.0</td></tr>
</table>

<h3>Details</h3>

<p>
A closed-form solution is used to value the Barrier Option. In the
case of Barrier options, the calculations are from Haug's "Option
pricing formulas" book (McGraw-Hill).
</p>
<p>
Please see any decent Finance textbook for background reading, and
the <code>QuantLib</code> documentation for details on the <code>QuantLib</code>
implementation.
</p>


<h3>Value</h3>

<p>
An object of class <code>BarrierOption</code> (which inherits from class
<code><a href="Option.html">Option</a></code>) is returned. It contains a list with the
following components: 
</p>
<table summary="R argblock">
<tr valign="top"><td><code>value</code></td>
<td>
Value of option</td></tr>
<tr valign="top"><td><code>delta</code></td>
<td>
Sensitivity of the option value for a change in the underlying</td></tr>
<tr valign="top"><td><code>gamma</code></td>
<td>
Sensitivity of the option delta for a change in the underlying</td></tr>
<tr valign="top"><td><code>vega</code></td>
<td>
Sensitivity of the option value for a change in the
underlying's volatility</td></tr>
<tr valign="top"><td><code>theta</code></td>
<td>
Sensitivity of the option value for a change in t, the
remaining time to maturity</td></tr>
<tr valign="top"><td><code>rho</code></td>
<td>
Sensitivity of the option value for a change in the
risk-free interest rate</td></tr>
<tr valign="top"><td><code>dividendRho</code></td>
<td>
Sensitivity of the option value for a change in the
dividend yield</td></tr>
<tr valign="top"><td><code>parameters</code></td>
<td>
List with parameters with which object was created</td></tr>
</table>
<p>
.
<br>
Note that under the new pricing framework used in QuantLib, binary
pricers do not provide analytics for 'Greeks'. This is expected to be
addressed in future releases of QuantLib.</p>

<h3>Note</h3>

<p>
The interface might change in future release as <code>QuantLib</code>
stabilises its own API.
</p>


<h3>Author(s)</h3>

<p>
Dirk Eddelbuettel <a href="mailto:edd@debian.org">edd@debian.org</a> for the <font face="Courier New,Courier" color="#666666"><b>R</b></font> interface;
the QuantLib Group for <code>QuantLib</code>
</p>


<h3>References</h3>

<p>
<a href="http://quantlib.org">http://quantlib.org</a> for details on <code>QuantLib</code>.
</p>


<h3>See Also</h3>

<p>
<code><a href="AmericanOption.html">AmericanOption</a></code>,<code><a href="EuropeanOption.html">EuropeanOption</a></code>
</p>


<h3>Examples</h3>

<pre>
BarrierOption(barrType="downin", type="call", underlying=100,
        strike=100, dividendYield=0.02, riskFreeRate=0.03,
        maturity=0.5, volatility=0.4, barrier=90)
</pre>



<hr><div align="center">[Package <em>RQuantLib</em> version 0.1.14 <a href="00Index.html">Index]</a></div>

</body></html>
